//
//  ARFindHeardView.m
//  AriseSamePro
//
//  Created by 包日守 on 15/10/22.
//  Copyright © 2015年 Arise. All rights reserved.
//

#import "ARFindHeardView.h"
#import "UIViewAdditions.h"
#import "ZJLoopScrollView.h"



@interface ARFindHeardView ()<ZJLoopScrollViewDelegate>

@property (nonatomic,weak) ZJLoopScrollView *scV;
@end

@implementation ARFindHeardView


- (void)awakeFromNib
{
    

}

- (void)setHeadModel:(ARFindHeadModel *)headModel
{
    
    _headModel = headModel;
    
    NSMutableArray *array = [NSMutableArray array];
    
    for (ARTheamModel *theam in _headModel.themes) {
        [array addObject:[NSURL URLWithString:theam.src]];
        
    }
    ZJLoopScrollView * scV = [[ZJLoopScrollView alloc] initWithFrame:self.bounds];
    [self addSubview:scV];
    
    self.scV = scV;
    
    scV.imagesUrl = array;
    scV.pageControl.hidden = YES;
    
    scV.autoScroll = YES;
    
    scV.delegate = self;
    
    
}



- (void)setAutoScroll:(BOOL)autoScroll
{
    self.scV.autoScroll = autoScroll;

}


#pragma mark - ZJScollViewDelegate
- (void) zjLoopScrollView:(ZJLoopScrollView *)loopscrollView WithIndex:(int)index
{
    if (self.headViewDelegate) {
        //  if ([self p:@selector(findVeiw:WithIndex:)]) {
        
        [self.headViewDelegate findVeiw:self WithIndex:index];
        
        // }
    }


}


@end
